import { Space, Typography } from 'antd'
import type { ColumnsType } from 'antd/es/table'
import type { TableData } from './types'
type fun = (...set: any) => void
export const eventColumns = (props: Record<string, fun>): ColumnsType<TableData> => [
  {
    title: '编号',
    align: 'center',
    dataIndex: 'numbering',
  },
  {
    title: '名称',
    align: 'center',
    dataIndex: 'name',
    key: 'name',
  },
  {
    title: '型号',
    align: 'center',
    dataIndex: 'model',
    key: 'model',
  },
  {
    title: '厂商',
    align: 'center',
    dataIndex: 'manufacturer',
    key: 'manufacturer',
  },
  {
    title: '数量',
    align: 'center',
    dataIndex: 'total_num',
    key: 'total_num',
  },
  {
    title: '操作',
    align: 'center',
    fixed: 'right',
    width: 100,
    render: (data: TableData) => (
      <Space size="large">
        <Typography.Link
          onClick={() => {
            props?.onEdit(data?.id, data?.type)
          }}
        >
          编辑
        </Typography.Link>
      </Space>
    ),
  },
]
